package com.briup.smartlabs.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.briup.smartlabs.bean.SmartEnvDetail;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.briup.smartlabs.bean.ex.SysLog;
import com.briup.smartlabs.mapper.ex.SysLogMapper;
import com.briup.smartlabs.service.SysLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
@RequiredArgsConstructor
public class SysLogServiceImpl implements SysLogService{

	private final SysLogMapper logMapper;

	@Override
	public PageInfo<SysLog> findByCondition(int pageNum, int pageSize, Date begin, Date end, String key) {
		//分页+条件查询
		//1.开启分页查询
		PageHelper.startPage(pageNum,pageSize);

		//2.执行常规条件查询
		List<SysLog> allByCondition = logMapper.findAllByCondition(begin, end, key);

		//3.封装查询数据到 PageInfo对象中
		//4.返回结果
		return new PageInfo<>(allByCondition);
	}
}





